<div id="central_body_title">All Users in the data base</div>
<div id="deletion"><p style="color: green"><%= flash[:notice] %></p></div>
<table>
 <tr>
   <th>Name</th>
   <th>Email</th>
	<th>Privilege</th>
 </tr>

<% for user in @users %>
 <tr>
   <td><%=h user.name %></td>
   <td><%=h user.email %></td>
   <td><%=h user.privilege %></td>
   <%if user.privilege == 1 and user.email == @user.email %>
   		<td>Other administrator can delete you</td>
   <%else%>
   		<td><%= link_to_remote "Delete user", :method => "delete", :url => {:id => user.id }, :update => "central_body", :confirm => 'Are you sure?' %></td>
   <%end%>
 </tr>
<% end %>
</table>

<br />
<%= link_to 'Back', :action => 'index', :controller=>"users" %>